package top.lwaiting.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.lwaiting.bean.OrderBean;
import top.lwaiting.service.OrderService;

/**
 * 订单服务
 * @Description
 * @ClassName OrderController
 * @Author Yang
 * @Date 2025/5/28 15:53
 * @Version 1.0
 */
@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    /**
     * @Description 创建订单
     * @Author Yang
     * @Date 17:57 2025/5/28
     * @Param
     * @return
     **/
    @GetMapping("create")
    public OrderBean createOrder(@RequestParam("productId") Long productId,
                                 @RequestParam("userId") Long userId) {
        OrderBean order = orderService.createOrder(productId, userId);

        return order;
    }
}
